<?php

/**
 * InputElninoLanina filter form base class.
 *
 * @package    TMD
 * @subpackage filter
 * @author     Thaihosting
 */
abstract class BaseInputElninoLaninaFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'SISSUE_NO'          => new sfWidgetFormFilterInput(),
      'DTISSUE_TIME'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'DTSTARTTIME'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'DTENDTIME'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'SGENERAL_SITUATION' => new sfWidgetFormFilterInput(),
      'SFORECAST'          => new sfWidgetFormFilterInput(),
      'SEFFECT'            => new sfWidgetFormFilterInput(),
      'SOBSERVATION'       => new sfWidgetFormFilterInput(),
      'SREMARK'            => new sfWidgetFormFilterInput(),
      'SIMAGE_FILE'        => new sfWidgetFormFilterInput(),
      'IUSER_ID'           => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'SISSUE_NO'          => new sfValidatorPass(array('required' => false)),
      'DTISSUE_TIME'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'DTSTARTTIME'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'DTENDTIME'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'SGENERAL_SITUATION' => new sfValidatorPass(array('required' => false)),
      'SFORECAST'          => new sfValidatorPass(array('required' => false)),
      'SEFFECT'            => new sfValidatorPass(array('required' => false)),
      'SOBSERVATION'       => new sfValidatorPass(array('required' => false)),
      'SREMARK'            => new sfValidatorPass(array('required' => false)),
      'SIMAGE_FILE'        => new sfValidatorPass(array('required' => false)),
      'IUSER_ID'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('input_elnino_lanina_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'InputElninoLanina';
  }

  public function getFields()
  {
    return array(
      'IELNINO_ID'         => 'Number',
      'SISSUE_NO'          => 'Text',
      'DTISSUE_TIME'       => 'Date',
      'DTSTARTTIME'        => 'Date',
      'DTENDTIME'          => 'Date',
      'SGENERAL_SITUATION' => 'Text',
      'SFORECAST'          => 'Text',
      'SEFFECT'            => 'Text',
      'SOBSERVATION'       => 'Text',
      'SREMARK'            => 'Text',
      'SIMAGE_FILE'        => 'Text',
      'IUSER_ID'           => 'Number',
    );
  }
}
